﻿<html>

	<head>
		<meta charset="utf-8">
		<meta name="format-detection" content="telephone=no">
		<meta name="viewport" content="minimal-ui=yes,width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	
		<title>{$ticket_types['name']}_{$web_name}</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta name="Keywords" content="{$ticket_types['keywords']}" />
		<meta name="Description" content="{$ticket_types['description']}" />
		<link rel="stylesheet" type="text/css" href="__TMPL__Public/css/public.css" />
		<link rel="stylesheet" type="text/css" href="__TMPL__Public/css/category.css" />
		<script type="text/javascript" src="__TMPL__Public/js/jquery.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/jquery.json.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/transport.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/common.js"></script>
		
		<script type="application/javascript" src="__TMPL__Public/js/jquery.more.js"></script>
	</head>

	<body class="body_bj">
		<section class="_pre">

			<header id="head_search_box" style="position: fixed; top: 0px; width: 100%; z-index:9999;">
				<div class="cate_header">
					<div class="cate_left">
						<a href="javascript:history.back(-1)" class="sb-back" title="返回"></a>
					</div>
					<div class="cate_mid">
						<form id="searchForm" name="searchForm" method="get" action="{:U('search/index')}" onSubmit="return checkSearchForm()">
							<div class="text_box" name="list_search_text_box" onclick="return 1;">
								<input id="keyword" name="keyword" type="text" placeholder="请输入商品名称" class="text" value="">
								<input type="submit" value="" class="submit" id="list_search_submit">
							</div>
						</form>
					</div>
					<div class="cate_right">
						<a class="menu filtrate" name="list_go_filter" style=" color:#666">筛选</a>
					</div>
				</div>
				</div>
			</header>

			<div style="height:46px;" class="empty_div">&nbsp;</div>
			
			<section class="filtrate_term" id="product_sort" style="width: 100%; z-index:9999; border-bottom:1px solid #CCC">
				<ul>
					<php>$orders=I('get.order',0);</php>
					<li <eq name="orders" value="0">class="on"</eq>> 
						<a href="{:U('list/index',array('id'=>$_GET['id'],'order'=>0))}">最新</a>
					</li>
					<li <eq name="orders" value="1">class="on"</eq>>
						<a href="{:U('list/index',array('id'=>$_GET['id'],'order'=>1))}">销量</a>
					</li>
					<li <eq name="orders" value="2">class="on"</eq>>
						<a href="{:U('list/index',array('id'=>$_GET['id'],'order'=>2))}">热门</a>
					</li>
					<li <eq name="orders" value="3">class="on"</eq> <eq name="orders" value="4">class="on"</eq>>
						<php>
							if($orders==3){
						</php>
							<a href="{:U('list/index',array('id'=>$_GET['id'],'order'=>4))}">价格<span class="arrow_up "></span><span class="arrow_down  <eq name='orders' value='3'>active_down</eq>"></span></a>
						<php>}else{</php>
						
							<a href="{:U('list/index',array('id'=>$_GET['id'],'order'=>3))}">价格<span class="arrow_up <eq name='orders' value='4'>active_up</eq>"></span><span class="arrow_down"></span></a>
						<php>}</php>
						
					</li>
					<li style=" border-left:1px solid #ccc; margin-right:-1px;">
						<a href="javascript:;" class="show_type  show_list">&nbsp;</a>
					</li>
				</ul>
			</section>
			<div style=" height:5px"></div>
			<script type="text/javascript">
				var url = "{:U('list/ajax_getshop',array('id'=>$_GET['id'],'order'=>$_GET['order'],'types'=>$_GET['types']))}";
				$(function() {
					$('#J_ItemList').more({
						'address': url
					});
				});
			</script>
			<div class="touchweb-com_searchListBox openList" id="goods_list">
				<form action="javascript:void(0)" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY">
					<div id="J_ItemList" style="opacity: 1;">
						<div class="product single_item info"></div>
						<a href="javascript:;" class="get_more">
						</a>
					</div>
				</form>
				<script language="javascript" type="text/javascript">
					function goods_cut($val) {
						var num_val = document.getElementById('number_' + $val);
						var new_num = num_val.value;
						var Num = parseInt(new_num);
						if(Num > 1) Num = Num - 1;
						num_val.value = Num;
					}

					function goods_add($val) {
						var num_val = document.getElementById('number_' + $val);
						var new_num = num_val.value;
						var Num = parseInt(new_num);
						Num = Num + 1;
						num_val.value = Num;
					}
				</script>

			</div>
			</div>
		</section>
		<section class="_next" style="-webkit-transform-origin: 0px 0px 0px; opacity: 1; -webkit-transform: scale(1, 1); display: none;">
			<header>
				<div class="new_header_2" id="filter_header">
					<a href="javascript:;" class="back" id="list_filter_back"><span>返回</span></a>
					<h2>筛选</h2>
				</div>
			</header>
			<section id="filter_content">
				
					<input type="hidden" name="brand" id="brand" value="{$brand|default='0'}">
					<input type="hidden" name="price" id="price" value="{$price|default='0'}">
					<input type="hidden" name="filter_attr" id="filter_attr" value="{$filter_attr|default='0'}">
					<input type="hidden" name="id" value="{$_GET['id']}">
					<php>
						if($brand==null||$brand==0){
							$brand='无';
						}
						if($price==null){
							$price='无';
						}else{
							$newprice=explode('-',$price);
							$min_price=$newprice[0];
							$max_price=$newprice[1];
						}
						
						if(empty($filter_attr)){
							$filter_attr='无';
						}else{
							$filter_attr=explode(',',$filter_attr);
							foreach( $filter_attr as $k=>$v){   
							    if(!$v){
							    	 unset($filter_attr[$k] );   
							    } 
							}
						}
					</php>
					<div class="filtrate_category">
						<a href="javascript:;" class="filtrate_category_a">品牌 <span class="up_down">全部展开</span></a>
					</div>

					<ul class="clearfix filtrate_address filtrate_list att_item" id="brands" style="display: block; -webkit-transform-origin: 0px 0px 0px; opacity: 1; -webkit-transform: scale(1, 1);">
						<li id="brand_0" <eq name="brand" value="无">class="on"</eq>> 
 							<a href="javascript:get_brand('0')">全部</a>
						</li>
						<foreach name="brand_array" item="v">
							<li id="brand_{$v['id']}" <eq name="brand" value="$v['id']">class="on"</eq> >
								<a href="javascript:get_brand('{$v['id']}')">{$v.name}</a>
							</li>
						</foreach>
					</ul>

					<php>if(!$price_sx){</php>
						<div class="filtrate_category">
							<a href="javascript:;" class="filtrate_category_a">价格 <span class="up_down">全部</span></a>
						</div>
						<ul class="clearfix filtrate_address filtrate_list att_item filtrate_list_price" id="attrs_1">
							<li <eq name="price" value="无">class="on"</eq> >
								<a href="javascript:;" data="" class="price">全部</a>
							</li>
							<foreach name="price_array" item="v">
							<li <eq name="price" value="$v">class="on"</eq>>
								<a href="javascript:;" class="price" data="{$v}">{$v}</a>
							</li>
							</foreach>
							<div class="filtrate_price" onclick="return 1;">
			                    <input type="number" id="lp" placeholder="0" name="price_min"  oninput="get_price(event)" onpropertychange="get_price(event)">∼
			                    <input type="number" id="hp" placeholder="0" name="price_max"  oninput="get_price(event)" onpropertychange="get_price(event)">元
					        </div>
						</ul>
					<php>}</php>
					<foreach name="ticket_atr" item="vo" key="k">
						<php> if(!in_array($k,$keys)){</php>
						<div class="filtrate_category">
							<a href="javascript:;" class="filtrate_category_a">{$vo.title} <span class="up_down">全部</span></a>
						</div>
						<ul class="clearfix filtrate_address filtrate_list att_item" id="attrs_1">
							<li>
								<a href="javascript:;" data="" class="attr" >全部</a>
							</li>
							<foreach name="vo['content']" item="v">
								<php>if(in_array($v,$filter_attr)){</php>
								<li class="on">
								<php>}else{</php>
								<li >	
								<php>}</php>
									<a href="javascript:;" class="attr" data="{$v}">{$v}</a>
								</li>
							</foreach>

						</ul>

						<php> }</php>
					</foreach>
					<dl>

						<dd class="moredd">&nbsp;</dd>
						<dd>
							<ul>

							</ul>
						</dd>
					</dl>

					<script>
						$('.filtrate_has li').click(function() {
							$(this).find("input").attr("checked", "checked");
							$('.filtrate_has li').removeClass("on");
							$(this).addClass("on");
						})
					</script>
					<script>
						$('.filtrate_has1 li').click(function() {
							if($(this).hasClass("on")) {
								$(this).find("input").attr("checked", "");
								$(this).removeClass("on");
							} else {
								$(this).find("input").attr("checked", "checked");
								$(this).addClass("on");
							}

						})
					</script>

					<ul class="filtrate_btn">
						<li>
							<a href="javascript:;" class="reset" id="clear_btn">取消筛选</a>
						</li>
						<li> <input class="submit" id="submit_btn" type="button" value="确定"></li>
					</ul>
				
			</section>
		</section>
		<section id="mix_search_div" style="display: none;">
			<div class="cate_header">
				<div class="cate_left">
					<a href="javascript:history.back(-1)" class="sb-back" title="返回"></a>
				</div>
				<div class="cate_mid">
					<form id="searchForm" name="searchForm"  method="get" action="{:U('search/index')}" onSubmit="return checkSearchForm()">
						<div class="text_box" name="list_search_text_box" onclick="return 1;">
							<input id="keyword1" name="keyword" type="text" value="" placeholder="请输入商品名称" class="text" onkeydown="this.style.color=&#39;#404040&#39;;" maxlength="70" autocomplete="off">
							<input type="submit" value="" class="submit">
						</div>
					</form>
				</div>
				<div class="cate_right">
					<a href="javascript:void(0)" class="clear_input" id="clear_input" style="display: block;">取消</a>
				</div>
			</div>
			<section class="mix_recently_search">
				<h3><i class="search_h2"></i><span>热门搜索</span></h3>
				<ul>
					<php>$web_search=explode(',',$web_search);	</php>
            		<foreach name="web_search" item="v">
            			<li>
            			<a href="{:U('search/index',array('keyword'=>$v))}">{$v}</a>
            			</li>
            		</foreach>
				</ul>
			</section>
		</section>
		<script type="text/javascript" src="__TMPL__Public/js/zepto.min.js"></script>
		<script type="text/javascript" src="__TMPL__Public/js/filter.min.js"></script>
		<script>
			$(document).ready(function() {
				//筛选浮层显示控制
				var filtrate = $(".filtrate"),
					submit = $(".submit,.back,.reset");
				filtrate.bind("click", function() {
					$("._next").show();
					$("._pre").hide();
					window.scrollTo(0, 0);
				});
				submit.bind("click", function() {
					$("._next").hide();
					$("._pre").show();
				});
				//初始化筛选浮层
				bizFilter.init();
			});
		</script>
		<script>
			$(function() {
				//搜索浮层显示逻辑
				var sbox = $("#head_search_box"),
					sort = $('#product_sort'),
					g_list = $("#goods_list"),
					g_m1 = "0",
					g_m2 = "96px";
				var initCss = function(type) {
					if(type == 1) {
						sort.css({
							"position": "static",
							"width": "100%"
						});
						g_list.css("margin-top", g_m1);
					} else {
						sort.attr("style", "");
						g_list.css("margin-top", g_m2);
					}
				};
				var m = {
					input: $("#keyword"),
					rawAll: '',
					dd: $(".text_box"),
					cancel: $(".mix_back"),
					rawKey: '请输入商品名称',
					main: function() {
						this.init();
						this.be();
					},
					init: function() {
						this.rawAll = this.input.val();
					},
					be: function() {
						var _this = this;
						this.input.focus(function() {
								var mix_search = $("#mix_search_div");
								if(mix_search.length > 0) {
									$("._pre").hide();
									mix_search.show();
									$("#keyword1").focus();
									return;
								}
								var newKey = _this.input.val();
								if(newKey != _this.rawKey && newKey != _this.rawAll) {
									$(this).val(newKey);
								} else {
									$(this).val(_this.rawKey);
								}
								if($(window).scrollTop() > 0) {
									initCss(1);
									window.scrollTo(0, 0);
									_this.dd.trigger("click"); //for ddclick
								}
							})
							.blur(function() {
								var newKey = _this.input.val();
								if(newKey === _this.rawKey) {
									$(this).val(_this.rawAll);
								} else {
									$(this).val(newKey);
								}
							});
						this.cancel.bind("click", function() {
							$("#mix_search_div").hide();
							$("._pre").show();
						});
						document.getElementById("clear_input").onclick = function() {
							$("#mix_search_div").hide();
							$("._pre").show();
						}
					}
				};
				m.main();
				$(window).resize(function() {
					sbox.css("width", "100%");
					sort.css("width", "100%");
				});
				//顶部sticky效果
				setTimeout(function() {
					var sboxH = sbox.height();
					var sortH = sort.height();
					var sortStart = sort.offset().top - sboxH;
					var showEnd = sort.offset().top;
					var init = function() {
						sbox.css({
							"position": "fixed",
							"top": "0"
						});
						window.scrollTo(0, 0);
					};
					var rawScroll = 0,
						nowScroll = 0;
					var upOrDown = function() {
						var delta = 30;
						if(nowScroll > rawScroll + delta) {
							return 1;
						} else if(nowScroll < rawScroll - delta) {
							return 2;
						} else {
							return 0;
						}
					};
					var sticky = function() {
						nowScroll = $(window).scrollTop();
						if(nowScroll >= sortStart) {
							sort.css({
								"position": "fixed",
								"top": sboxH,
								"z-index": "9999"
							});
							g_list.css({
								"margin-top": sortH
							});
						} else {
							sort.attr("style", "");
							g_list.attr("style", "");
						}
						if(nowScroll > showEnd + sortH) {
							var up = upOrDown();
							if(up == 1) {
								if(sbox.css("display") != "none") {
									sbox.hide();
									sort.hide();
								}
								rawScroll = nowScroll;
							} else if(up == 2) {
								if(sbox.css("display") == "none") {
									sbox.show();
									sort.show();
								}
								rawScroll = nowScroll;
							}
						} else {
							if(sbox.css("display") == "none") {
								sbox.show();
								sort.show();
							}
						}
					};
					init();
					$(document).on("touchmove", sticky);
					$(window).on("scroll", sticky);
				}, 500);

			});
		</script>
		<script>
			$('.show_type').bind("click", function() {
				if($('#goods_list').hasClass('openList')) {
					$('#goods_list').removeClass('openList');
					$(this).removeClass('show_list');
				} else {
					$('#goods_list').addClass('openList');
					$(this).addClass('show_list');
				}
			});
		</script>
		<script type="text/javascript">
			function get_brand(brand_id) {
				document.getElementById('brand').value = brand_id;
				var obj = document.getElementById('brands').getElementsByTagName('li');
				for(var i = 0; i < obj.length; i++) {
					obj[i].className = '';
				}
				document.getElementById('brand_' + brand_id).className = 'on';
				$('#brand').val(brand_id)
			}
			var obj = $('.filtrate_list');
			for(var i = 0; i < obj.length; i++) {
					if(!$('.filtrate_list').eq(i).children('li').hasClass('on')){
						$('.filtrate_list').eq(i).children('li').eq(0).addClass('on')
					}
			}
			var min_price='{$min_price}';
			var max_price='{$max_price}';
			if(!$('.filtrate_list_price').children('.on').attr('data')){
				$('.filtrate_list_price li').removeClass('on');
				$('#lp').val(min_price);
				$('#hp').val(max_price);
			}
			$(function(){
				$('.attr').click(function(){
					var attr=$(this).attr('data');
					$(this).parent('li').siblings().removeClass('on');
					$(this).parent('li').addClass('on');
					var obj = $('.on .attr');
					var choose='';
					for(var i = 0; i < obj.length; i++) {
						var attr=obj[i].text;
						if(attr!='全部'){
							choose+=attr+',';
						}
					}
					$('#filter_attr').val(choose)
				
				});
				$('.price').click(function(){
					var attr=$(this).attr('data');
					$(this).parent('li').siblings().removeClass('on');
					$(this).parent('li').addClass('on');
					var choose=$(this).attr('data');
					$('#price').val(choose)
				});
				
				$('#submit_btn').click(function(){
					var brand=$('#brand').val();
					var price=$('#price').val();
					var filter_attr=$('#filter_attr').val();
					$.post("{:U('list/ajax_getattr')}",{brand:brand,price:price,filter_attr:filter_attr},function(result){
						
					   location.reload();
					});
				})
				$('#clear_btn').click(function(){
				
					$.post("{:U('list/clear_getattr')}",{brand:1},function(result){
						
					   location.reload();
					});
				})
				
				
			})

			function get_price() {
				var price_min = document.getElementById('lp').value;
				var price_max = document.getElementById('hp').value;
				var price=price_min+'-'+price_max;
				$('.price').parent('li').siblings().removeClass('on');
				$('#price').val(price)
			}
			function checkSearchForm(){
				var keyword1= $('#keyword1').val();
				if(keyword1){
					return true;
				}else{
					alert('请输入商品名称！')
					return false;
				}
			}
		</script>
		<script type="Text/Javascript" language="JavaScript">
			function selectPage(sel)
			{
			  sel.form.submit();
			}
		</script>
		<mtc_include file="Public:footer" />
		<script>
			function goTop() {
				$('html,body').animate({
					'scrollTop': 0
				}, 600);
			}
		</script>
		<a href="javascript:goTop();" class="gotop" style=" z-index:9999"><img src="__TMPL__Public/picture/topup.png"></a>
	</body>

</html>